import 'package:flutter/material.dart';
import 'package:smart_home/utils/color_utils.dart';
import '../utils/extension/double.dart';

class Cell extends StatelessWidget {
  final String iconUri;
  final String title;

  const Cell({Key? key, required this.iconUri, required this.title})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding:
          EdgeInsets.only(top: 30.px, bottom: 30.px, left: 20.px, right: 20.px),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Container(
            width: 90.px,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Image.asset(
                  "static/icons/$iconUri.png",
                  width: 22.px,
                ),
                Container(
                  child: Text(
                    title,
                    style: TextStyle(fontWeight: FontWeight.w600),
                  ),
                ),
              ],
            ),
          ),
          Icon(Icons.keyboard_arrow_right)
        ],
      ),
    );
  }
}

class Cell2 extends StatelessWidget {
  final String title;
  final List<Widget> children;

  const Cell2({Key? key, required this.title, required this.children})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      // height: 50.px,
      padding:
          EdgeInsets.only(top: 30.px, bottom: 30.px, left: 15.px, right: 15.px),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            title,
            style: TextStyle(fontWeight: FontWeight.w700, fontSize: 16.px),
          ),
          Row(
            children: [
              ...children,
              Icon(
                Icons.keyboard_arrow_right,
                color: ColorsUtil.hexColor(0x8d8d8d),
              )
            ],
          )
        ],
      ),
    );
  }
}